/**
 * 
 */
package com.tien.action;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Tien E-mail:g.tianxin@gmail.com
 * @version Time：2011-8-12 下午11:53:51
 */
@SuppressWarnings("serial")
@Controller
@Scope("prototype")
public class LoginAction extends ActionSupport {
	private String userName;
	private String password;
	public void setUserName(String name) {
		userName = name;
	}

	public void setPassword(String pwd) {
		password = pwd;
	}

	public String execute() {
		System.out.println("-----------start");
		if ("gae".equals(userName) && "struts2".equals(password)) {

			addActionMessage("Welcome," + userName);
			System.out.println("-----------success");
			return SUCCESS;

		}

		addActionError("Username and Password Combination doesnot match.");
		System.out.println("-----------input");
		return INPUT;

	}

}